package com.my.mapper;

import org.apache.flink.streaming.connectors.redis.common.mapper.RedisCommand;
import org.apache.flink.streaming.connectors.redis.common.mapper.RedisCommandDescription;
import org.apache.flink.streaming.connectors.redis.common.mapper.RedisMapper;

public class MyRedisMapper implements RedisMapper<String> {
    @Override
    public RedisCommandDescription getCommandDescription() {
        return new RedisCommandDescription(RedisCommand.SET);
    }

    @Override
    public String getKeyFromData(String s) {
        System.out.println(s);
        return s;
    }

    @Override
    public String getValueFromData(String s) {
        String s1 = s + "1234";
        System.out.println(s1);
        return s1;
    }


    public static MyRedisMapper getMapper(){
        return new MyRedisMapper();
    }
}
